package com.aierkeji.call.cms.controller;

import java.util.Map;

import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.aierkeji.call.cms.contants.Contants;
import com.aierkeji.call.cms.service.AkjCallClueHistoryService;

@RestController
@RequestMapping("/clueHistory")
public class AkjCallClueHistoryController {

	
	@Autowired
	AkjCallClueHistoryService akjCallClueHistoryService;

	@PostMapping("/list/{pageNo}")
	@RequiresRoles(value = { Contants.ROLE_ID_MANAGER }, logical = Logical.OR)
	public Map<String, Object> list(@PathVariable(name = "pageNo") int pageNo, @RequestBody Map<String, Object> map) {
		return akjCallClueHistoryService.query(pageNo, map);
	}
	
	@PostMapping("/delete/{id}")
	@RequiresRoles(value = { Contants.ROLE_ID_MANAGER }, logical = Logical.OR)
	public Map<String, Object> delete(@PathVariable(name = "id") long id) {
		return akjCallClueHistoryService.delete(id);
	}
}
